var app = sm("do_App");
var page = sm("do_Page");
var nf = sm("do_Notification");
var openHelper = require("helper/open");
var btnSuccess = ui("btnSuccess");
var orderUrl = require("url/order");
var httpSilence = require("helper/httpSilence");
var shareHUtil = require("helper/share");
var rootview = ui("$");
var addShare = rootview.add("share","source://view/reuse/share.ui", 0, 0);
page.on("back", function() {
	app.closePage({fromPage:"pay_success"},"",2);
});

var headerAout = ui("headerAout");
var addheader = headerAout.add("header", "source://view/reuse/header.ui", 0, 0);
var header = ui("header");
ui(addheader + ".labelTitle").text = "支付完成";
//左上角-返回
var headerLeft = ui(addheader+".headerLeft");
headerLeft.on("touch", function() {
	//关闭本页面和下层1个页面  
    app.closePage({fromPage:"pay_success"},"",2);
});

var order;
//页面装载完成后，开始初始化工作
page.on("loaded", function(){
	httpSilence.post(orderUrl.url.base.orderSuccess, {orderNo:page.getData().orderNo}, function(data) {
		order=data.detail;
	})
});
//页面装载完成后，开始初始化工作
btnSuccess.on("touch", function() {
	var orderNo = page.getData().orderNo;
	openHelper.open("source://view/order/detail.ui", {orderNo : orderNo,fromPage:"pay_success"});
});
/*
var do_Button_share=ui("do_Button_share");
ui("do_Button_share").on("touch", "", 300, function() {
	page.fire("onShare",{showView:"true",shareTitle:"圈圈生活买东西，就是这么便捷",shareContent:"下载注册圈圈生活，更多便捷和优惠等着您。",shareId:order.id,shareType:shareHUtil.type.SHARE_ORDER,shareImage:""});
});
*/